package dnuifood_cjy.dnuifood_16110100529.model;

import dnuifood_cjy.dnuifood_16110100529.iface.FoodIface;
import dnuifood_cjy.dnuifood_16110100529.listener.OnRetrofitListener;
import dnuifood_cjy.dnuifood_16110100529.service.FoodService;

import retrofit2.Call;

public class FoodModel extends BaseModel implements FoodIface {

    private FoodService foodService;


    public FoodModel(){
        foodService=retrofit.create(FoodService.class);

    }



    public void isCollected(String user_id, String shop_food_id, String flag, OnRetrofitListener listener) {
        Call call=foodService.isCollected(user_id,shop_food_id,flag);
        bindCallback(call,listener,3);
    }




    public void userCollectFood(String user_id, String food_id, OnRetrofitListener listener) {
        Call call=foodService.userCollectFood(user_id,food_id);
        bindCallback(call,listener,4);
    }
    public void getFoodById(String food_id,OnRetrofitListener listener) {
        Call call = foodService.getFoodById(food_id);
        bindCallback(call,listener, 1); }

    @Override
    public void getAllCommentsByFood(String user_id, OnRetrofitListener listener) {

    }


}
